package com.vj.service.impl;

import com.vj.dao.BookDao;
import com.vj.dao.UserDao;
import com.vj.dao.impl.BookDaoImpl;
import com.vj.dao.impl.UserDaoImpl;
import com.vj.service.BookService;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class BookServiceImpl implements BookService, InitializingBean, DisposableBean {
    public BookDao bookDao;
//    public UserDao userDao;

    public void save() {
        System.out.println("service book save");
//        bookDao.save();
        bookDao.save();
    }

//    public BookServiceImpl(UserDao userDao) {
//        this.userDao = userDao;
//    }

    //提供对应set方法
    public void setBookDao(BookDao bookDao) {
        System.out.println("9999999999");
        this.bookDao = bookDao;
    }

    public void destroy() throws Exception {
        System.out.println("service book destroy");
    }

    public void afterPropertiesSet() throws Exception {
        System.out.println("service book afterPropertiesSet");
    }

//    public void setUserDao(UserDaoImpl userDao) {
//        this.userDao = userDao;
//    }
}
